#include<bits/stdc++.h>
using namespace std;
int main(){
	char c[1000] = {0};
	int k;
	cin >> c >> k;
	int l = strlen(c);
	while(k > 0){
		for(int i = 0 ; i <= l - 1 ; i++){
			if(i != l - 1 && c[i] > c[i + 1]){
				for(int j = i ; j < l - 1 ; j++){
					c[j] = c[j + 1];
				}
				break;
			}
		}
		l = l - 1;
		k = k - 1;
	}
	int flag = 0 , f = 0;
	for(int i = 0 ; i <= l - 1 ; i++){
		if(flag == 0 && c[i] == '0'){
			continue;
		}
		else{
			flag = 1;
			cout << c[i];
			f = 1;
		}
	}
	if(f == 0){
		cout << 0 << endl;
	}
	return 0;
}
